package org.xqp.hrm.doc;

import lombok.Data;
import org.springframework.data.annotation.Id;
import org.springframework.data.elasticsearch.annotations.Document;
import org.springframework.data.elasticsearch.annotations.Field;
import org.springframework.data.elasticsearch.annotations.FieldType;

import java.util.Date;

//课程
//indexName:索引库名字； type:类型
@Document(indexName = "hrmtest",type = "course")
@Data
public class CourseDoc {

    //标记文档ID
    @Id
    private Long id;

    //课程名字 :要分词 ，指定IK分词器
    @Field(type =FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String name;

    //适用人群  要分词 ，创建索引的时候指定IK分词器，搜索的时候也指定IK分词器
    @Field(type =FieldType.Text,analyzer = "ik_max_word",searchAnalyzer = "ik_max_word")
    private String forUser;

    // 不分词
    @Field(type =FieldType.Keyword)
    private String gradeName;

    private Long courseTypeId;

    // 不分词
    @Field(type =FieldType.Keyword)
    private String tenantName;

    // 不分词
    @Field(type =FieldType.Keyword,index = false)
    private String pic;

    private Long tenantId;

    private Integer saleCount;

    private Integer viewCount;

    private Integer commentCount;

    private Date onlineTime;

    @Field(type =FieldType.Keyword)
    private String chargeName;

    private Float price;

    private Float priceOld;

}
